<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/22
 * Time: 15:19
 */

use yii\widgets\ActiveForm;
use common\components\widgets\Datetimepicker;

Datetimepicker::widget(['timepicker' => 'false', 'datepicker' => 'true', 'step' => '5']);
?>
<div class="yx-praise-list-box yx-praise-box yx-radius2 zx-min-height">
    <?php $form = ActiveForm::begin(['enableAjaxValidation' => true, 'enableClientValidation' => false, 'options' => ['class' => 'form-validate']]); ?>
    <table width="100%" class="table-form">
        <tr>
            <th class="zx-goods-table"><?= $model->attributeLabels()['code']; ?></th>
            <td><?= $form->field($model, 'code', ['template' => '{input}{hint}{error}'])->textInput(['style' => 'width:220px', 'class' => 'input-text'])->hint('字段名一旦确定，不能修改。') ?></td>
        </tr>
        <tr>
            <th class="zx-goods-table"><?= $model->attributeLabels()['notes']; ?></th>
            <td><?= $form->field($model, 'notes', ['template' => '{input}{hint}{error}'])->textInput(['style' => 'width:220px', 'class' => 'input-text']) ?></td>
        </tr>
        <tr>
            <th class="zx-goods-table"><?= $model->attributeLabels()['is_required']; ?></th>
            <td><?= $form->field($model, 'is_required', ['template' => '{input}{hint}{error}'])->dropDownList(['0' => '否', '1' => '是'], ['prompt' => '请选择', 'style' => 'width:220px', 'class' => 'input-dropdownlist']) ?></td>
        </tr>
        <tr>
            <th class="zx-goods-table"><?= $model->attributeLabels()['type']; ?></th>
            <td><?= $form->field($model, 'type', ['template' => '{input}{hint}{error}'])->dropDownList(['text' => '文本框', 'select' => '下拉框', 'textarea' => '文本域'], ['prompt' => '请选择', 'style' => 'width:220px', 'class' => 'input-dropdownlist']) ?></td>
        </tr>
        <tr>
            <th class="zx-goods-table"><?= $model->attributeLabels()['module']; ?></th>
            <td><?= $form->field($model, 'module', ['template' => '{input}{hint}{error}'])->dropDownList(['customer' => '会员', 'student' => '学员'], ['prompt' => '请选择', 'style' => 'width:220px', 'class' => 'input-dropdownlist']) ?></td>
        </tr>
        <tr>
            <th class="zx-goods-table"><?= $model->attributeLabels()['type_value']; ?></th>
            <td><?= $form->field($model, 'type_value', ['template' => '{input}{hint}{error}'])->textarea(['style' => 'width:220px', 'class' => 'input-text'])->hint('下拉框时用到，每个值用空格隔开。') ?></td>
        </tr>
        <tr>
            <th class="zx-goods-table"><?= $model->attributeLabels()['data_type']; ?></th>
            <td><?= $form->field($model, 'data_type', ['template' => '{input}{hint}{error}'])->dropDownList(['0' => '字符串', '1' => '数字'], ['prompt' => '请选择', 'style' => 'width:220px', 'class' => 'input-dropdownlist']) ?></td>
        </tr>
        <tr>
            <th class="zx-goods-table"><?= $model->attributeLabels()['default_value']; ?></th>
            <td><?= $form->field($model, 'default_value', ['template' => '{input}{hint}{error}'])->textarea(['style' => 'width:220px', 'class' => 'input-text'])->hint('请根据数据类型，填写默认值。') ?></td>
        </tr>
    </table>
    <div class="yx-submit-box" style="width: 100%;padding-left:280px;">
        <?= \yii\helpers\Html::submitButton('提交', ['class' => "button yx-submit"]) ?>
    </div>
</div>
<?php \yii\widgets\ActiveForm::end(); ?>

